/**
 * 
 */
package com.jm.utils.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import com.jm.utils.GlobalHelper;

/**
 * @author yanjie
 * Dec 14, 2011 8:56:26 AM
 */
public class GlobalServlet extends HttpServlet{
	private static final long serialVersionUID = -1049389524972797701L;
	@Override
	public void init() throws ServletException {
		//產生global對像 
		GlobalHelper globalHelper = createGlobalHeper();
		this.getServletContext().setAttribute(GlobalHelper.TAG_GlobalHelper,globalHelper);
		globalHelper.load();
	}
	
	protected GlobalHelper createGlobalHeper(){
		GlobalHelper globalHelper = new GlobalHelper(this.getServletContext());
		globalHelper.init();
		return globalHelper;
	}
}
